//
//  MyOCTest.m
//  C_OC_Swift
//
//  Created by Finer  Vine on 2019/6/9.
//  Copyright © 2019 Vine. All rights reserved.
//

#import "MyOCTest.h"

@implementation MyOCTest

- (void)ocStarFunction{
    printf("\nOC开始函数\n");
    //这里我们不需要暴露的函数，不需要提前声明了。
    //对于程序执行编译依然是自上而下。
    
    NSInteger num = 0;
    
    [self printHello];
    
    num = [self returnOne];
    printf("无參有返回值-->%ld\n",num);
    
    [self printNum:5];
    
    num = [self addOne:5];
    printf("有參有返回值-->%ld\n",num);
    
    num = [self addTwoNum:3 andWithNum:5];
    printf("多参有返回值-->%ld\n",num);
    
    
}

//无参函数
-(void)printHello{
    
    printf("无参函数\n");
}
//无参有返回值
-(NSInteger)returnOne{
    
    return 1;
}

//有参无返回值
-(void)printNum:(NSInteger)num{
    printf("有參无返回值-->%ld\n",num);
}

//有参有返回值
-(NSInteger)addOne:(NSInteger)num{
    return num +1;
}

//多参有返回值
-(NSInteger) addTwoNum:(NSInteger)num1 andWithNum:(NSInteger)num2{
    return num1 + num2;
}

@end
